package com.szqhyxj.youxiangju.sys.util;

import android.util.Log;

import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * XiaoPanYu
 * on 2018/11/8
 */
public class DataUtils{
    public static String timeStamp2Day(long seconds){
        String format = "yyyy-MM-dd";
        SimpleDateFormat sdf = new SimpleDateFormat(format);

        String a = "yyyyMMdd";
        SimpleDateFormat b = new SimpleDateFormat(a);
        String c = b.format(new Date(seconds));
        Log.w("123",sdf.format(new Date(seconds))+"---"+c);
        return sdf.format(new Date(seconds));

    }

    public static String timeStamp2Day(String seconds){
        String format = "yyyy-MM-dd";
        SimpleDateFormat sdf = new SimpleDateFormat(format);
        return sdf.format(new Date(Long.valueOf(seconds)));
    }

    public static String timeStamp2Hour(String seconds){
        String format = "HH:mm";
        SimpleDateFormat sdf = new SimpleDateFormat(format);
        return sdf.format(new Date(Long.valueOf(seconds)));
    }

    public static String timeStamp2Hour(long seconds){
        String format = "HH:mm";
        SimpleDateFormat sdf = new SimpleDateFormat(format);
        return sdf.format(new Date(seconds));
    }
}
